package gupao.concurrency.demo.risk.model;

import lombok.Getter;
import lombok.Setter;

import java.util.concurrent.atomic.AtomicReference;

public class RiskCapitalCalcContext {

    private AtomicReference<NodeTree> deptTree = new AtomicReference<>();

    @Getter
    private final RiskJob job;

    @Getter
    @Setter
    private Throwable lastError;

    public RiskCapitalCalcContext(NodeTree tree,  RiskJob job) {
        this.deptTree.set(tree);
        this.job = job;
    }

    public NodeTree getDeptTree() {
        return deptTree.get();
    }

}
